From 68321cfcd5b0d04171aa1fc642373b9afe7fcbb6 Mon Sep 17 00:00:00 2001 From: Michael Schumacher Date: Tue, 13 Mar 2007 19:44:35 +0000 Subject: [PATCH] AC_SUBST and AC_DEFINE $shrext into variables for Makefiles and source. 2007-03-13 Michael Schumacher * configure.ac: AC_SUBST and AC_DEFINE $shrext into variables for Makefiles and source. * extension/Makefile.am: use $(SHREXT) instead of .$(SOext). * babl/babl-extension.c: use SHREXT instead of a hardcoded ".so" and get rid of a dirent->d_ino > 0 check which has been there for reasons unknown. svn path=/trunk/; revision=229 --- ChangeLog | 9 +++++++++ babl/babl-extension.c | 5 ++--- configure.ac | 8 ++++++++ extensions/Makefile.am | 15 ++++++--------- 4 files changed, 25 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index c42f8e5..706902f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2007-03-13 Michael Schumacher + + * configure.ac: AC_SUBST and AC_DEFINE $shrext into variables for + Makefiles and source. + * extension/Makefile.am: use $(SHREXT) instead of .$SOext. + * babl/babl-extension.c: use SHREXT instead of a hardcoded ".so" + and get rid of a dirent->d_ino > 0 check which has been there for + reasons unknown. + 2007-03-12 Michael Schumacher * Makefile.am: diff --git a/babl/babl-extension.c b/babl/babl-extension.c index 9236aba..3047bee 100644 --- a/babl/babl-extension.c +++ b/babl/babl-extension.c @@ -223,8 +223,7 @@ babl_extension_load_dir (const char *base_path) while ((dentry = readdir (dir)) != NULL) { - if (dentry->d_name[0] != '.' && - dentry->d_ino > 0) + if (dentry->d_name[0] != '.') { char *path = NULL; struct stat st; @@ -237,7 +236,7 @@ babl_extension_load_dir (const char *base_path) stat (path, &st); if ((extension = strrchr (dentry->d_name, '.')) !=NULL && - !strcmp (extension, ".so")) + !strcmp (extension, SHREXT)) { babl_extension_load (path); } diff --git a/configure.ac b/configure.ac index bb54b15..bc97373 100644 --- a/configure.ac +++ b/configure.ac @@ -202,6 +202,14 @@ AC_DEFINE_UNQUOTED(BABL_PATH, "~/.babl-$BABL_API_VERSION:/usr/local/lib/babl-$BA AC_DEFINE(BABL_PATH_SEPERATOR, "/", [string used to seperate directories in a path string]) AC_DEFINE(BABL_LIST_SEPERATOR, ':', [seperator between paths in BABL_PATH]) +##################################### +# File extension for shared libraries +##################################### + +SHREXT=$shrext +AC_SUBST(SHREXT) +AC_DEFINE_UNQUOTED(SHREXT, "$shrext", [File extension for shared libraries]) + dnl =========================================================================== diff --git a/extensions/Makefile.am b/extensions/Makefile.am index 491d667..f8d3a5d 100644 --- a/extensions/Makefile.am +++ b/extensions/Makefile.am @@ -3,15 +3,12 @@ if OS_WIN32 no_undefined = -no-undefined -SOsuf=dll libbabldlla=$(top_builddir)/babl/.libs/libbabl-$(BABL_API_VERSION).dll.a -else -SOsuf=so endif CFILES = $(wildcard $(srcdir)/*.c) -SOBJS = $(subst $(srcdir)/,,$(CFILES:.c=.$(SOsuf))) -INSTALLED_ITEMS = $(subst $(srcdir),$(ext_dir),$(CFILES:.c=.$(SOsuf))) +SOBJS = $(subst $(srcdir)/,,$(CFILES:.c=$(SHREXT))) +INSTALLED_ITEMS = $(subst $(srcdir),$(ext_dir),$(CFILES:.c=$(SHREXT))) EXTRA_DIST = $(wildcard *.[ch]) all-local: $(SOBJS) @@ -22,17 +19,17 @@ LDFLAGS += -shared LDADD = $(no-undefined) $(libbabldlla) -%.$(SOsuf): %.c +%$(SHREXT): %.c $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LDADD) # if extension needing external libraries are to be # compiled with this make # file, each of them can be added according to the this pattern: -# extra.$(SOsuf): extra.c +# extra$(SHREXT): extra.c # $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< [own compile and link flags] -CIE-Lab.$(SOsuf): CIE-Lab.c +CIE-Lab$(SHREXT): CIE-Lab.c $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LDADD) $(MATH_LIB) -#lcms.$(SOsuf): lcms.c +#lcms$(SHREXT): lcms.c # $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LDADD) `pkg-config lcms --cflags --libs` ############################################################################# -- 2.30.2